#ifndef _HELPER_H_
#define _HELPER_H_

#include <sstream>
#include <string>

#define MIN(X,Y) ((X) < (Y) ? (X) : (Y))

struct SGlobalInfo
{
	unsigned int instructionCount;
	unsigned int currentInstruction;

	bool branchAdded;
	unsigned int branchPosition;
	std::string branchName;

	bool branchBackward;
	unsigned int regName;
	unsigned int startValue;
};


template <class R, class T> R Convert(const T& i)
{
	std::stringstream ss;
	ss << i;
	R out;
	ss >> out;
	return out;
}


#endif
